package com.entity.customer;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.sql.Timestamp;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("customer_companies") // 映射到数据库表名
public class CustomerCompanies {

    @ApiModelProperty(value = "客户公司ID，主键，唯一标识每家公司")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "公司名称，不能为空")
    @TableField("company_name")
    private String companyName;

    @ApiModelProperty(value = "公司地址，可选字段")
    @TableField("address")
    private String address;

    @ApiModelProperty(value = "联系电话，可选字段")
    @TableField("phone_number")
    private String phoneNumber;

    @ApiModelProperty(value = "邮箱地址，可选字段")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "记录创建时间，默认为当前时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "记录更新时间，每次更新时自动刷新")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}